package cn.wolfcode.wolf2w.business.api.factory;

import cn.wolfcode.wolf2w.business.api.RemoteUserEsService;
import cn.wolfcode.wolf2w.business.api.domain.UserEs;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


@Component
public class RemoteUserEsfallbackFactory implements FallbackFactory<RemoteUserEsService>{

    @Override
    public RemoteUserEsService create(Throwable cause) {
        return new RemoteUserEsService() {
            @Override
            public R<?> initUserEs(UserEs userEs, String source) {
                return R.fail("初始化用户es失败", cause.getMessage());
            }
        };
    }
}
